import { createStore } from 'vuex'
import state from './state'
import actions from './actions'
import mutations from './mutations'
import getters from './getters'
import activity from './modules/activity'

export const EventBus = window.mitt();
EventBus.$off = EventBus.off;
EventBus.$on = EventBus.on;
EventBus.$emit = EventBus.emit;

// 创建一个新的 store 实例
const store = createStore({
  state,
  mutations,
  actions,
  getters,
  modules: {
    activity
  }
})

export default store